package com.syh.jn.scm.service.api.supplier.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/12/10.
 */
public interface StorehouseEnums {

    @AllArgsConstructor
    @Getter
    public enum State{

        ENABLED(Short.valueOf("1"), "已启用"),
        DISABLED(Short.valueOf("-1"), "已停用");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static State valueOf(Short status) {
            switch (status) {
                case -1:
                    return DISABLED;
                case 1:
                    return ENABLED;
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IsPerchaseToSale{

        YES(Short.valueOf("1"), "直采直销仓库"),
        NO(null, "非直采直销仓库");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static IsPerchaseToSale valueOf(Short status) {
            switch (status) {
                case 1:
                    return YES;
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum Type{

        REAL(Short.valueOf("1"), "实体仓库"),
        FICTITIOUS(Short.valueOf("2"), "逻辑仓库");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static Type valueOf(Short status) {
            switch (status) {
                case 1:
                    return REAL;
                case 2:
                    return FICTITIOUS;
            }
            return null;
        }
    }
}
